<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;

/**
 * SystemNotice控制器
 */
class SystemNotice extends AdminBase
{
    
    /**
     * Notice列表
     */
    public function NoticeList()
    {

        
        $this->assign('list', $this->logicSystemNotice->getNoticeList($this->param, 'a.*,c.username', 'a.id desc'));
        
        return $this->fetch('notice_list');
    }
    
    /**
     * Notice添加
     */
    public function NoticeAdd()
    {
        
        $this->NoticeCommon();
        
        return $this->fetch('notice_edit');
    }
    
    /**
     * Notice编辑
     */
    public function NoticeEdit()
    {
        
        $this->NoticeCommon();

        $info = $this->logicSystemNotice->getNoticeInfo($this->param, 'a.*');

        
        $this->assign('info', $info);
        
        return $this->fetch('notice_edit');
    }
    
    /**
     * Notice添加与编辑通用方法
     */
    public function NoticeCommon()
    {
        
        IS_POST && $this->jump($this->logicSystemNotice->NoticeEdit($_POST));
        

    }



    

    /**
     * 数据状态设置
     */
    public function setStatus()
    {
        
        $this->jump($this->logicAdminBase->setStatus('UserNotice', $this->param));
    }
}
